package com.zeroinverse.voicerecorder;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ImageButton;
import android.widget.Spinner;
import android.widget.Toast;

public class RecordActivity extends Activity 
implements ImageButton.OnClickListener, AdapterView.OnItemSelectedListener {
	
	private ImageButton recordButton;
	private Spinner timeLimitSpinner;
	private String[] timeLimitItems = {
			"0", "10", "20", "30", "40", "50", "60"};

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.record);
        
        recordButton = (ImageButton)findViewById(R.id.record_button);
        recordButton.setOnClickListener(this);
        
        timeLimitSpinner = (Spinner)findViewById(R.id.time_limit_spinner);
        timeLimitSpinner.setOnItemSelectedListener(this);
        ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>(
        		this, 
        		android.R.layout.simple_spinner_item, 
        		timeLimitItems);
        arrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        timeLimitSpinner.setAdapter(arrayAdapter);
    }
    
    public void onClick(View v) {
    	if ((ImageButton)v == recordButton) {
    		Toast.makeText(this, "Start recording...", Toast.LENGTH_SHORT).show();
    	}
    }
    
    public void onItemSelected(AdapterView<?> parent, View v, int position, long id) {
    	
    }
    
    public void onNothingSelected(AdapterView<?> parent) {
    	
    }
}
